<template>
  <div :class="{'hidden':hidden}" class="pagination-container">
<!--    <el-pagination-->
<!--        :background="background"-->
<!--        :current-page.sync="currentPage"-->
<!--        :page-size.sync="pageSize"-->
<!--        :layout="layout"-->
<!--        :page-sizes="pageSizes"-->
<!--        :total="total"-->
<!--        v-bind="$attrs"-->
<!--        @size-change="handleSizeChange"-->
<!--        @current-change="handleCurrentChange"-->
<!--    />-->
    <el-pagination
        background
        layout="prev, pager, next"
        :total="total">
    </el-pagination>
  </div>
</template>

<script>

export default {
  name: 'Pagination',
  props: {
    total: {
      required: true,
      type: Number
    },
    page: {
      type: Number,
      default: 1
    },
    limit: {
      type: Number,
      default: 20
    },
    pageSizes: {
      type: Array,
      default() {
        return [5, 10, 20, 30, 50]
      }
    },
    layout: {
      type: String,
      // default: 'total, sizes, prev, pager, next, jumper'
      default: 'prev, pager, next'

    },
    background: {
      type: Boolean,
      default: true
    },
    autoScroll: {
      type: Boolean,
      default: true
    },
    hidden: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    currentPage: {
      get() {
        return this.page
      },
      set(val) {
        this.$emit('update:page', val)
      }
    },
    pageSize: {
      get() {
        return this.limit
      },
      set(val) {
        this.$emit('update:limit', val)
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.pagination-container {
  background: #fff;
  padding: 15px;
  text-align: center;
}

.pagination-container.hidden {
  display: none;
}

::v-deep .el-input__inner {
  border-radius: 0 !important;
}
:deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #0046FF;
  color: #FFF;
}
:deep .el-pagination.is-background .el-pager li:not(.disabled).active:hover {
  color: #FFF;
}
:deep .el-pagination.is-background .el-pager li:not(.disabled):hover {
  color: #0046FF;
}
:deep .el-pagination.is-background .el-pager li {
  margin: 0 5px;
  background-color: #f4f4f5;
  color: #606266;
  min-width: 40px;
  min-height: 40px;
  border-radius: 2px;
}
:deep .el-pager li {
  padding: 0 4px;
  background: #FFF;
  font-size: 13px;
  min-width: 35.5px;
  height: 40px;
  line-height: 40px;
  box-sizing: border-box;
  text-align: center;
}
:deep .el-pagination button{
  display: inline-block;
  font-size: 13px;
  min-width: 35.5px;
  height: 40px;
  line-height: 40px;
  vertical-align: top;
  box-sizing: border-box;
}
</style>
